<template>
  <el-dialog
      v-model="dialogVisible"
      title="选择模板"
      width="500"
      :before-close="handleClose"
  >
    <div>

    </div>
    <template #footer>
      <div class="dialog-footer">
        <el-button @click="handleClose">关闭</el-button>
        <el-button type="primary" @click="handleClose">确认</el-button>
      </div>
    </template>
  </el-dialog>
</template>

<script setup name="SelectTemplate">

const {proxy} = getCurrentInstance();

const emit = defineEmits(['update:modelValue'])

const props = defineProps({
  modelValue: Boolean
})

const dialogVisible = ref(false);

const handleClose = () => {
  // 关闭窗口前触发
  emit('update:modelValue', false);
}

// 监听传入参数变化
watch(() => props.modelValue, () => {
  dialogVisible.value = props.modelValue;
});

</script>
